package com.Brave.manager.Demo02;

import java.io.*;
import java.util.Arrays;

public class Demo05 {
    public static void main(String[] args) throws IOException {
        BufferedReader bs = new BufferedReader(new FileReader("D:\\JAVA\\File\\a.txt"));

        String str = bs.readLine();
        System.out.println(str);

        bs.close();

        String[] cs =  str.split(" ");
        int [] is = new int[cs.length];

        for (int i = 0; i < cs.length; i++) {
            String strs = cs[i];
            int inew = Integer.parseInt(strs);
            is[i] = inew;
        }

        Arrays.sort(is);

        System.out.println(Arrays.toString(is));

        BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\JAVA\\File\\b.txt"));
        for (int i = 0; i < is.length; i++) {
            bw.write(is[i]+" ");
            bw.flush();
        }
        bw.close();

    }
}
